<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:s="http://jboss.org/schema/seam/taglib">

  <ui:composition template="template.xhtml">
    <ui:define name="content">

      <div class="errors"><h:messages globalOnly="true"/></div>

      <s:div rendered="#{commentAction.comment == null}">
        Could not create comment.
      </s:div>

      <s:div rendered="#{selectedMember != null}">

        <s:div id="blogMemberCard">
	        <s:link view="/profile.seam" propagation="none">
	          	#{selectedMember.memberName}<br/>
            <h:graphicImage value="/content/images?id=#{selectedMember.picture.imageId}&amp;width=90"/>	          	
	        </s:link>

          <br style="clear:both"/>
        </s:div>

				<s:div id="blog">
          <div class="blogEntry">
	          <div class="blogDate">#{selectedBlog.formattedEntryDate}</div>
            <div class="blogTitle">#{selectedBlog.title}</div>
            <div class="blogText"><s:formattedText value="#{selectedBlog.text}"/></div>
          </div>

          <s:div rendered="#{commentAction.comment.comment != null}">
            Preview:
	          <table class="blogComment">
	            <tr>
		            <td class="blogCommentText">
		              <p><s:formattedText value="#{commentAction.comment.comment}"/></p>
		            </td>
	            </tr>
	          </table>
          </s:div>

          <div class="commentEntry">
            <h:form>

              <h:outputLabel for="comment">Please type your comment</h:outputLabel><br/>
              <h:inputTextarea id="comment" value="#{commentAction.comment.comment}"/><br/>

              <div class="buttons">
                <h:commandButton action="#{commentAction.saveComment}" value="Add comment" styleClass="action"/>
                <h:commandButton value="Preview" styleClass="action"/>
              </div>

              <br class="clear"/>
            </h:form>
          </div>

          <div>
            <b>Seam Text Quick Reference</b><br/>
            <pre><code>
*bold* /italic/ |monospace| -strikethrough- ^super^ _underline_

+Big Heading
Headings must be followed by text

++Smaller heading
Paragraphs are ended with a blank line.

#ordered list item

=unordered list item

"quoted text"
            </code></pre>
          </div>

        </s:div>

      </s:div>

      <br class="clear"/>

    </ui:define>

  </ui:composition>
</html>
